from SB import Dowmload, Method_1


# a=int(input('\n'))
# if a==1:
#     Method_1()
# else:
#     print('SB')


import requests
from bs4 import BeautifulSoup
from urllib.parse import urlencode



#网页提取
def get_one(i):
    try:
        headers= {
        'User-Agent':'User-Agent:Mozilla/5.0(WindowsNT10.0;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/81.0.4044.138Safari/537.36'
                }
        paras = {
        'reportTiem':'2020-03-31',
        'pageNum':[x for x in range(i)]
            }
        url = "https://s.askci.com/stock/a/?"+urlencode(paras)
        print(url)


        response = requests.get(url,headers=headers)
        if response.status_code == 200:
            return response.text
    except response.exceptions.RequsetException:
        print("爬取出错")
        for x in i:
            print(get_one(x))

get_one(4)
a=[x for x in range(5)]
print(a)















